<?php
/* @var $this \yii\web\View */
/* @var $content string */

//use yii;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use common\components\CatelogHelper;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
    <head>
        <meta charset="<?= Yii::$app->charset ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="applicable-device" content="pc,mobile">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> 
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <?= Html::csrfMetaTags() ?>
        <title><?= Html::encode($this->title) ?></title>
        <!--<meta content="<?//= Html::encode($this->description) ?>" name="description">-->
        <?php $this->head() ?>
        <!--百度统计 start-->
        <!--百度统计 end-->
    </head>
    <body>
        <?php $this->beginBody() ?>
        <div class="wrap">
            <?php
            NavBar::begin([
                'brandLabel' => Yii::$app->params['brand_name'],
                'brandUrl' => Yii::$app->homeUrl,
                'options' => [
                    'class' => 'navbar-inverse navbar',
                ],
            ]);
            //  获取career title=>url 数组
            $catelog = ArrayHelper::index(CatelogHelper::CatelogMenu(), 'label');
            $menuItem1 = [
                ['label' => Yii::t('common', 'Home'), 'url' => '/'],
                ['label' => Yii::t('common', 'Posts'), 'url' => '/subject/list'],
            ];
            $menuItem2 = [
                ['label' => Yii::t('common', 'Sltopics'), 'url' => '/sltopic'],
                ['label' => Yii::t('common', 'Zytopic'), 'url' => ['/zytopic']],
                ['label' => Yii::t('common', 'About US'), 'url' => ['/page/about']],
            ];
            $menuItems = array_merge($menuItem1,$catelog,$menuItem2);
            echo Nav::widget([
                'options' => ['class' => 'navbar-nav navbar-left'],
                'items' => $menuItems,
            ]);
            ?>
            <div class="nav navbar-nav navbar-right">
<!--                <form class="navbar-form navbar-right" action="/topic/" method="get">
                    <div class="form-group">
                        <input type="text" class="form-control" name="name" value="" placeholder="搜索文章">
                    </div>
                    <button type="submit" class="btn btn-primary">搜&nbsp;索</button>
                </form>-->
            </div>
            <?php
            NavBar::end();
            ?>
            <div class="container">
                <?=
                Breadcrumbs::widget([
                    'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
                ])
                ?>
            </div>
            <div class="grey">
                <div class="container">
                    <?= Alert::widget() ?>
                    <?= $content ?>
                </div>
            </div>
        </div>

        <footer class="footer">
<!--            <div class="container">
                <ul>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">关于我们</a></li>
                    <li><a href="#">意见反馈</a></li>
                    <li><a href="#">友情链接</a></li>
                    <li><?php //include_once("analyticstracking.php")   ?></li>
                </ul>
            </div>-->
            <div class="container">
                <p class="pull-left">Copyright © 2014-<?= date('Y') ?> <a href="<?= Yii::$app->params['frontend_domain'] ?>"><?= Yii::$app->params['brand'] ?></a> All rights reserved.</p>
            </div>
            <div class="container">
                <dl class="links">
                    <!--<dt>友情链接：</dt>                    
                    <dd><a href="http://www.hivps.cn/" target="_blank">hivps</a></dd>
					-->
                </dl>
            </div>            
        </footer>
		<?php include_once("analyticstracking.php") ?>
        <?php $this->endBody() ?>		
    </body>
</html>
<?php $this->endPage() ?>
